package src.com.hpu.service;

import com.hpu.callback.InfoCallback;
import com.hpu.constants.HttpConstants;
import com.hpu.constants.ShareConstants;
import com.hpu.constants.UrlConstants;
import com.hpu.tools.InternetTools;
import com.hpu.tools.OkHttpTools;
import com.hpu.tools.ShareTools;

import android.content.Context;
import android.os.Handler;

/**
 * 个人信息业务类，获取个人信息
 * @author Administrator
 *
 */
public class InfoService{

	private Handler handler;
	
	private Context context;
	
	public InfoService(Handler handler,Context context) {
		this.handler=handler;
		this.context=context;
	}
	
	public void getInfo() {
		if(InternetTools.statusInternet(context)==InternetTools.NO_INTERNET)
			handler.sendEmptyMessage(HttpConstants.NO_INTERNET);
		else
		OkHttpTools.getByCookie(UrlConstants.INTERFACE_INFO,
				ShareTools.get(context,ShareConstants.STORE_LOGINCOOKIE, "").toString(),
				new InfoCallback(handler));
	}

}
